<?php
//LIFO last in first out
class Stack
{
	private $arr = array();
	
	public function __construct(array $arr)
	{
		$this->arr = $arr;
	}
	
	public function insert($item)
	{
		//inset to the start of the array
		array_push($this->arr, $item);
	}
	
	public function get()
	{
		//get the first element that instert
		return array_pop($this->arr);
	}
	
	public function getData()
	{
		return $this->arr;
	}
}